﻿using System.Collections.Generic;

namespace Sustainalytics.LongRunningTaskManager.Interface
{
    /// <summary>
    /// Repository interface for Long Running Task instance snapshot.
    /// </summary>
    public interface ILongRunningTaskInstanceSnapshotRepository
    {
        /// <summary>
        /// Get snapshot by ID.
        /// </summary>
        /// <param name="id"> Snapshot ID. </param>
        /// <returns> Task instance snapshot. </returns>
        LongRunningTaskInstanceSnapshot Get(string id);

        /// <summary>
        /// Get all task snapshots.
        /// </summary>
        /// <returns></returns>
        List<LongRunningTaskInstanceSnapshot> GetAll();

        /// <summary>
        /// Insert new task snapshot.
        /// </summary>
        /// <param name="snapshot"> Task instance snapshot. </param>
        void Insert(LongRunningTaskInstanceSnapshot snapshot);

        /// <summary>
        /// Insert multiple task snapshots.
        /// </summary>
        /// <param name="snapshots"> Multiple task instance snapshots. </param>
        void Insert(IEnumerable<LongRunningTaskInstanceSnapshot> snapshots);

        /// <summary>
        /// Update task instance snapshot.
        /// </summary>
        /// <param name="snapshot"> Task instance snapshot. </param>
        void Update(LongRunningTaskInstanceSnapshot snapshot);

        /// <summary>
        /// Delete one task instance snapshot.
        /// </summary>
        /// <param name="id"> Task instance snapshot ID. </param>
        void Delete(string id);

        /// <summary>
        /// Clear entire collection.
        /// </summary>
        void Clear();
    }
}
